﻿<UserControl x:Class="TriviaViews.Views.QuestionWizardView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="700" d:DesignWidth="700">
    <UserControl.Resources>
        <DataTemplate x:Key="AnswerDataTamplate">
            <Label Content="{Binding AnswerString}" FontSize="13" FontStyle="Normal"  Background="FloralWhite" ></Label>
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
        </Grid.RowDefinitions>


        <Border BorderThickness="5" BorderBrush="MistyRose" Margin="10">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Label HorizontalAlignment="Center" FontSize="20" Background="Firebrick">Add new Difficulty And/Or new Topic.</Label>
                <StackPanel Grid.Row="1" Orientation="Horizontal">
                    <Label Margin="20">Topic:</Label>
                    <TextBox Margin="20" Width="250" Text="{Binding TopicAdded}"></TextBox>
                    <Button Margin="20" Command="{Binding AddDiddicultyCommand}">Add Difficulty</Button>
                </StackPanel>

                <StackPanel  Grid.Row="2" Orientation="Horizontal">
                    <Label  Margin="20">Difficulty:</Label>
                    <TextBox Margin="20" Width="250" Text="{Binding DifficultyAdded}"></TextBox>
                    <Button Margin="20" Command="{Binding AddTopicCommand}">Add Topic</Button>
                </StackPanel>
            </Grid>
        </Border>

        <Border Grid.Row="1" Grid.ColumnSpan="2" BorderThickness="2" BorderBrush="Blue">
            <Grid Grid.Row="1" Grid.ColumnSpan="2" Background="Honeydew">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50*"></ColumnDefinition>
                    <ColumnDefinition Width="50*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel>
                    <Label Margin="10" FontWeight="DemiBold">Topics:</Label>
                    <ComboBox ItemsSource="{Binding Topics}" Grid.Column="1" Margin="10" SelectedItem="{Binding SelectedTopic}"></ComboBox>
                </StackPanel>

                <StackPanel Grid.Column="1">
                    <Label  Margin="10" FontWeight="DemiBold">Difficulties:</Label>
                    <ComboBox ItemsSource="{Binding Difficulties}"  Margin="10" SelectedItem="{Binding SelectedDifficulty}"></ComboBox>
                </StackPanel>

                <StackPanel Grid.Row="1" Grid.ColumnSpan="2">
                    <Label> Question</Label>
                    <DockPanel>
                        <Label Margin="5" FontWeight="DemiBold">Question String:</Label>
                        <TextBox Text="{Binding QuestionAdded}" Margin="5" Width="270"></TextBox>
                    </DockPanel>
                    <DockPanel>
                        <Label Margin="5" FontWeight="DemiBold">Add Image</Label>
                        <TextBlock>
                            <Image Source="{Binding QuestionAddedImageSource}" Name="img"></Image>
                        </TextBlock>
                        <Button Width="100" Margin="5" Command="{Binding AddPictureCommand}" Click="Button_Click">Add Picture</Button>
                    </DockPanel>
                   
                </StackPanel>
                <DockPanel Grid.Row="2" Grid.ColumnSpan="2">
                    <Label Margin="5" FontWeight="DemiBold">Answer:</Label>
                    <TextBox Text="{Binding AnswerAdded}" Margin="5" Width="250"></TextBox>
                    <StackPanel>
                        <CheckBox Margin="20,0"  Command="{Binding CheckedCommand}"  FontWeight="DemiBold">IsRightAnswer</CheckBox>
                        <Button  Command="{Binding AddAnswerCommand}" Margin="20,0" FontWeight="DemiBold">Add Answer</Button>
                    </StackPanel>

                </DockPanel>
                <DockPanel Grid.Row="3" Grid.ColumnSpan="2">
                    <Label Margin="5" FontWeight="DemiBold">Clue:</Label>
                    <TextBox Text="{Binding Clue}" Width="400"></TextBox>
                </DockPanel>
                <ListView Grid.Row="4" ItemTemplate="{StaticResource AnswerDataTamplate}"  ItemsSource="{Binding Answers}" Grid.ColumnSpan="2" ></ListView>
                <Button Command="{Binding AddQuestionDetailsCommand}" Grid.Row="5" Grid.ColumnSpan="2" Width="100">Add Question</Button>

            </Grid>
        </Border>


    </Grid>
</UserControl>
